<?php
    header('Content-Type:text/html;charset=utf-8');
    if(isset($_POST['button'])){

            $username=$_POST['username'];
            $pwd=$_POST['password'];

           mysql_connect('localhost','root','') or die(mysql_error());
           mysql_select_db('zhudata') or die('数据库选择失败');
           mysql_query('set names utf8');

           $sql = "insert into userData values(null,'$username','$pwd')";


         if(mysql_query($sql)){
//                header('location:admin.php');
                echo 1;
              }else {
                echo '添加失败';
              }

       }
?>
